// import { Button, Switch } from 'antd'
import React, { useCallback, useEffect } from 'react'
import API from '@/api/modules/billList'
import { useAppSelector, useAppDispatch } from '@/hooks/redux';
import { setBillList } from '@/redux/modules/billListReducer';

const MonthBill = () => {
  const dispatch = useAppDispatch();
  const billList = useAppSelector(state => state.billList.billList);

  const getList = useCallback(async () => {
    const res = await API.getMonthPageList()
    dispatch(setBillList(res.data.records))
  }, [dispatch]);

  useEffect(() => {
    getList()
  }, [getList])
  return (
    <div>
      {
        billList.map(item => {
          return (
            <div key={item.id}>
              {item.title}
            </div>
          )
        })
      }
    </div>
  )
}

export default MonthBill

